﻿namespace eCommerce.core.Helpers
{
    public class UrlHelper
    {
	public static string PagerArticle           = "javascript:Article.ListSearch({0});";
        public static string PagerProduct           = "javascript:Product.ListSearch({0});";
        public static string PagerCustomer          = "javascript:Customer.ListSearch({0});";
        public static string PagerCustomerBuySell   = "javascript:Customer.ListSearchBuySell({0});";
        public static string PagerOrder             = "javascript:Order.ListSearch({0});";
        public static string PagerCommentArticle    = "javascript:listComment({0},{1},{2});";
         
        public static string Cart
        {
            get { return "/gio-hang.htm"; } 
        }

        public static string ListByCategory(string categoryName)
        {
            return string.Format("/{0}.htm", categoryName);
        }

        public static string ListArticleByCategory(string categoryId, string categoryName)
        {
            return string.Format("/{0}/{1}.htm", categoryId, categoryName);
        }

        public static string ListPaginationArticleByCategory(string categoryName, string pageIndex)
        {
            return string.Format("/{0}/trang-{1}.htm", categoryName, pageIndex);
        }

        public static string ArticleDetail(string categoryName, int articleId, string title)
        {
            return string.Format("/{0}/{1}-a-{2}.htm", categoryName, title, articleId);
        }

        public static string ProductDetail(string categoryName, int productId, string productName)
        {
            return string.Format("/{0}/{1}-p-{2}.htm", categoryName, productName, productId);
        }        



        // group
        /************************************************************************************************************************************************************/
        public static string ListGroup
        {
            get { return "/Default.aspx?cId=2"; }
        }

        public static string CreateGroup
        {
            get { return "/Default.aspx?cId=2&ucId=edit"; }
        }

        public static string EditGroup(int id)
        {
            return string.Format("/Default.aspx?cId=2&ucId=edit&gId={0}", id);
        }

        public static string AdminGroupMenu(int id)
        {
            return string.Format("/Default.aspx?cId=2&ucId=agm&gId={0}", id);
        }

        // user
        /************************************************************************************************************************************************************/
        public static string ListUser
        {
            get { return "/Default.aspx?cId=3"; }
        }

        public static string CreateUser
        {
            get { return "/Default.aspx?cId=3&ucId=edit"; }
        }
        public static string EditUser(int id)
        {
            return string.Format("/Default.aspx?cId=3&ucId=edit&uId={0}", id);
        }

        public static string UserChangePassword
        {
            get { return "/Default.aspx?cId=5"; }
        }

        public static string UserInformation
        {
            get { return "/Default.aspx?cId=6"; }
        }

        public static string ChangePassword(int id)
        {
            return string.Format("/Default.aspx?cId=3&ucId=cpw&uId={0}", id);
        }

        public static string AdminGroupUser(int id)
        {
            return string.Format("/Default.aspx?cId=3&ucId=agu&uId={0}", id);
        }
        // admin menu
        /************************************************************************************************************************************************************/
        public static string ListMenu
        {
            get { return "/Default.aspx?cId=4"; }
        }

        public static string CreateMenu
        {
            get { return "/Default.aspx?cId=4&ucId=edit"; }
        }

        public static string EditMenu(int menuId)
        {
            return string.Format("/Default.aspx?cId=4&mId={0}&ucId=edit", menuId);
        }

        // article
        /************************************************************************************************************************************************************/
        public static string ListArticle
        {
            get { return "/Default.aspx?cId=19"; }
        }       

        // contact
        /************************************************************************************************************************************************************/
        public static string Contact
        {
            get { return "/lien-he.htm"; }
        }
    }
}
